package main

import (
	"fmt"
)
//map 其它用法
func main(){

	var citys map[string]string 
	citys=make(map[string]string,2)
	citys["no1"]="china"
	citys["no2"]="japanese"
	citys["no3"]="korean"
	citys["no4"]="北京"

	fmt.Println(citys)

	address:=make(map[string]string)
	address["name"]="tony"
	address["age"]="100"

	fmt.Println(address)

	country:=map[string]string{
		"no1":"中国",
		"no2":"美国",
	}
	fmt.Println(country)


	stuMap:=make(map[string]map[string]string)
	stuMap["stu1"] = make(map[string]string)
	stuMap["stu1"]["name"]="张三"
	stuMap["stu1"]["age"]="100"
	stuMap["stu1"]["sex"]="female"

	stuMap["stu2"] = make(map[string]string)
	stuMap["stu2"]["name"]="李四"
	stuMap["stu2"]["age"]="200"
	stuMap["stu2"]["sex"]="male"

	fmt.Println(stuMap)

	num:=[...]int{1,2,3}
	nums:=[]int{5,6,7}

	fmt.Printf("num=%T,nums=%T\n",num,nums)

	for i,v:=range num{
		fmt.Println(i,v)
	}
	for i,v:=range nums{
		fmt.Println(i,v)
	}

}